package com.sxit.tdf.server.controller;

import cn.dev33.satoken.annotation.SaCheckLogin;
import com.sxit.tdf.server.entity.Condition;
import com.sxit.tdf.server.response.R;
import com.sxit.tdf.server.service.IConditionService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 前端控制器
 *
 * @author 橙子高
 * @since 2022-02-08
 */
@RestController
@RequestMapping("/condition")
@Tag(name = "ConditionController", description = "用户状态控制器")
public class ConditionController {

  @Autowired private IConditionService conditionService;

  @GetMapping("/getAllCondition")
  @Operation(summary = "获取全部的用户状态")
  @SaCheckLogin
  public R getAllCondation() {
    List<Condition> list = conditionService.list();

    return R.ok().put("data", list);
  }
}
